package com.credithc.customers.base.ro;

import com.credithc.customers.base.codes.CustomerCodes;
import com.credithc.customers.base.exception.CustomerException;
import lombok.Data;
import org.apache.commons.lang.StringUtils;

/**
 * @description: 统一登录查询接口
 * @author: fby
 * @date: 2019/7/8 15:47
 * @param: null
 * @return:
 */
@Data
public class CustomerUnifyQueryInfoRo extends CustomerBaseRo {

    private String preCustomerNo;

    private String customerNo;

    private String targetSystemSign;

    private String targetSubSystemSign;

    public static void checkBaseParam(CustomerUnifyQueryInfoRo ro) {
        if (StringUtils.isBlank(ro.getTargetSystemSign())) {
            throw new CustomerException(CustomerCodes.PARAM_VALIDATE_ERROR, "目标系统标识不能为空");
        }
        if (StringUtils.isBlank(ro.getTargetSubSystemSign())) {
            throw new CustomerException(CustomerCodes.PARAM_VALIDATE_ERROR, "目标子系统标识不能为空");
        }
//        if (StringUtils.isBlank(ro.getCustomerNo())) {
//            throw new CustomerException(CustomerCodes.PARAM_VALIDATE_ERROR, "客户号不能为空");
//        }
//        if (StringUtils.isBlank(ro.getPreCustomerNo())) {
//            throw new CustomerException(CustomerCodes.PARAM_VALIDATE_ERROR, "用户号不能为空");
//        }
    }
}
